import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'

@Entity('ug_supplier')
export class SupplierEntity {
  @PrimaryGeneratedColumn({ name: 'supplier_id', type: 'int' })
  supplierId: number

  @Column({ name: 'name', type: 'varchar', length: 100 })
  name: string

  @Column({ name: 'contact', type: 'varchar', length: 50, nullable: true })
  contact?: string

  @Column({ name: 'mobile', type: 'varchar', length: 20, nullable: true })
  mobile?: string

  @Column({ name: 'address', type: 'varchar', length: 255, nullable: true })
  address?: string

  @Column({ name: 'bank_name', type: 'varchar', length: 100, nullable: true })
  bankName?: string

  @Column({ name: 'bank_account', type: 'varchar', length: 64, nullable: true })
  bankAccount?: string

  @Column({ name: 'settle_cycle', type: 'varchar', length: 20, default: 'weekly' })
  settleCycle: string

  @Column({ name: 'status', type: 'tinyint', default: 1 })
  status: number

  @CreateDateColumn({ name: 'create_time', type: 'datetime', precision: 6 })
  createTime: Date

  @UpdateDateColumn({ name: 'update_time', type: 'datetime', precision: 6 })
  updateTime: Date
}
